ComputerName = "."

Set dictDrives = CreateObject("Scripting.Dictionary")
Set listDriveLetters = CreateObject("System.Collections.ArrayList")

Set wmiServices = GetObject _
    ("winmgmts:{impersonationLevel=Impersonate}!//" & ComputerName)
Set wmiDiskDrives = wmiServices.ExecQuery _
    ("SELECT DeviceID FROM Win32_DiskDrive")

For Each wmiDiskDrive In wmiDiskDrives
    strEscapedDeviceID = Replace(wmiDiskDrive.DeviceID, "\", "\\", 1, -1, vbTextCompare)
    Set wmiDiskPartitions = wmiServices.ExecQuery _
        ("ASSOCIATORS OF {Win32_DiskDrive.DeviceID=""" & _
            strEscapedDeviceID & """} WHERE " & _
                "AssocClass = Win32_DiskDriveToDiskPartition")

    For Each wmiDiskPartition In wmiDiskPartitions
        Set wmiLogicalDisks = wmiServices.ExecQuery _
            ("ASSOCIATORS OF {Win32_DiskPartition.DeviceID=""" & _
                wmiDiskPartition.DeviceID & """} WHERE " & _
                    "AssocClass = Win32_LogicalDiskToPartition")

        For Each wmiLogicalDisk In wmiLogicalDisks
            listDriveLetters.Add wmiLogicalDisk.DeviceID
            dictDrives.Add wmiLogicalDisk.DeviceID, wmiDiskDrive.DeviceID
        Next
    Next
Next

Set wmiCDROMDrives = wmiServices.ExecQuery _
    ("Select DeviceID, Drive, MediaLoaded from Win32_CDROMDrive")

For Each wmiCDROMDrive in wmiCDROMDrives
    If wmiCDROMDrive.MediaLoaded Then          ' Only show drives with inserted media
        listDriveLetters.Add wmiCDROMDrive.Drive
        dictDrives.Add wmiCDROMDrive.Drive, wmiCDROMDrive.DeviceID
    End If
Next

listDriveLetters.Sort                          ' List the drives in alphabetical order

For Each strDriveLetter in listDriveLetters
	device = Right(dictDrives.Item(strDriveLetter),1) & " " & strDriveLetter
	WScript.Echo """\PhysicalDisk(" & device & ")\Avg. Disk Read Queue Length"""
	WScript.Echo """\PhysicalDisk(" & device & ")\Avg. Disk sec/Read"""
	WScript.Echo """\PhysicalDisk(" & device & ")\Avg. Disk sec/Transfer"""
	WScript.Echo """\PhysicalDisk(" & device & ")\Avg. Disk sec/Write"""
	WScript.Echo """\PhysicalDisk(" & device & ")\Avg. Disk Write Queue Length"""
	WScript.Echo """\PhysicalDisk(" & device & ")\Disk Read Bytes/sec"""
	WScript.Echo """\PhysicalDisk(" & device & ")\Disk Reads/sec"""
	WScript.Echo """\PhysicalDisk(" & device & ")\Disk Write Bytes/sec"""
	WScript.Echo """\PhysicalDisk(" & device & ")\Disk Writes/sec"""
Next